<%--
 *  File:   ClearSettingSum.jsp
 *
 *  Date		  Author		 
 *  2010-07-26	  banshang		  
 *
 *  Copyright (C) 2000 - 2005 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%
  //init param
  String privilegeCode = "E0531";
  String strTableName = "v_fileruleconfig";
  String strModuleName = "CFM";
	String contextPath = request.getContextPath();
%>
<%@ include file="/inc/CommonHeader.inc" %>
<%@ include file="/inc/OvalLocationDefault.inc" %>

<html>
<head>
<title>ClearSettingSum</title>
<PageFlow:CheckPageFlow pageName="p_dcpsummary"/>
<%@ include file="/inc/SumDiv.inc" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/SummaryDivision.js"></script>

<script language="JavaScript">
<%--  put your custom script here   --%>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "ClearSettingSum.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
function clickRow(id)
{
  var cform = document.cform;
  cform.datacleanprocessid.value=id;
}
function page_new()
{
	parent.down.location.href='ClearSettingEdit.jsp?<%= OvalTools.randomURL() %>';
}
function page_delete()
{
	var cform = document.cform;
	var id = cform.datacleanprocessid.value;
	if(isEmpty(id) || id == -1) return;
	if ( ! confirm("<%= message.getMessageDesc("ARE_YOU_SURE") %>") )  return;
	cform.actionname.value="deletedcp";
	cform.target = "_parent";
	isRunning = true;
    cform.submit();
}

function page_edit()
{
	var cform = document.cform;
	var id = cform.datacleanprocessid.value;
	if(isEmpty(id) || id == -1){
		alert('<%= message.getMessageDesc("ARE_YOU_SURE") %>');
		return;
	}
	parent.down.location.href='ClearSettingEdit.jsp?<%= OvalTools.randomURL() %>&datacleanprocessid='+id;
}
function page_detail(id)
{
  	parent.down.location.href='ClearSettingDetail.jsp?<%= OvalTools.randomURL() %>&datacleanprocessid='+id;
}
</script>
</head>

<body style="overflow: auto;">
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_dcpsummary">
    <input type="hidden" name="actionname">
    

<%--  page location   --%>
    <%@ include file="/inc/PageLocation.inc" %>

    <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="0" width="100%">
      <tr>
<%--  search criteria  --%>
      </tr>
          <tr class="deepblue-left" >
			  <td width="2%" class="title_center">&nbsp;</td>
	          <td class="title_center" width="8%"><%= label.getLabelName("L_ProcessCode") %>&nbsp;</td>
	          <td class="title_center" width="*"><%= label.getLabelName("L_ProcessDesc") %>&nbsp;</td>
	          <td class="title_center" width="15%"><%= label.getLabelName("L_DateLastUpdate") %>&nbsp;</td>
	          <td class="title_center" width="20%"><%= label.getLabelName("L_Type") %>&nbsp;</td>
	          <td class="title_center" width="20%"><%= label.getLabelName("L_Maker") %>&nbsp;</td>
	        </tr>
	        <%
             int j = 0;
             String strClassType = new String(); 
             Integer nDefaultId = new Integer(-1);  
             boolean bHasChecked = false;
             Vector totalsummary = (Vector)pageContext.getAttribute("alldcp");
             if(totalsummary == null) totalsummary = new Vector();
	             
	        %>
	          <logic:iterate id="summary" collection="<%= totalsummary %>">                      
	         <%
	            HashMap summaryMap = (HashMap)pageContext.getAttribute("summary");
	            if(summaryMap == null) summaryMap = new HashMap();
	            String strIsChecked = new String("");
	            
	            if(j%2 == 1){
	              strClassType = "td-listrom";             
	            }else{                    
	              strClassType = "";
	            }
	            
	            Integer currentid = (Integer)summaryMap.get("datacleanprocessid");
	            if(currentid == null) currentid = new Integer("-1"); 
	            
	            if(!bHasChecked){
		              strIsChecked = "Checked";                       
		              bHasChecked = true;
		              nDefaultId = currentid;
		        }       
	            j++;     
	          %>
	          <tr onmouseover="this.className='tr-over'" onmouseout="this.className='<%=JspHelper.filterNull(strClassType)%>'"  onClick="javascript:radiotrue('radio<%=JspHelper.filterNull(j)%>');clickRow('<custom:write property="datacleanprocessid" name="summary"/>')" class="<%=JspHelper.filterNull(strClassType)%>">
	            <td>
	              <input class="normalradio" id="radio<%=JspHelper.filterNull(j )%>" type="radio" name="radio" <%=JspHelper.filterNull( strIsChecked)%>>
	            </td>
	            <td>&nbsp;<A onclick="page_detail('<custom:write property="datacleanprocessid" name="summary"/>')"><custom:write property="dcpcode" name="summary"/></A></td>
	            <td>&nbsp;<custom:write property="processdesc" name="summary"/></td>
	            <td>&nbsp;<custom:write property="datelastupdated" name="summary" dataType="date" dataFormatName="dateformat" nbsp="true"/></td>
	            <td>&nbsp;<custom:write property="valuename" name="summary" nbsp="true"/></td>
	            <td>&nbsp;<custom:write property="username" name="summary" nbsp="true"/></td>
	          </tr>
	     	 </logic:iterate>
	      <%@ include file="/inc/SummaryAction.inc" %>
	      <input type="hidden" name="datacleanprocessid" value="<%=JspHelper.filterNull(nDefaultId )%>" />
	      </table>
	      <table width="100%" cellspacing="0" cellpadding="0">
	        <tr> 
	          <td class="summary_top"></td>
	        </tr>
	        <tr>
			     <td class="td_center">
					<a onclick="page_new()"><custom:button type="1" label="L_New" imgsrc="add.gif" border="0" style="width:60"/></a>
					<a onclick="page_edit()"><custom:button type="1" label="L_Edit" imgsrc="add.gif" border="0" style="width:60"/></a>
					<a onclick="page_delete()"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
				 </td>
			</tr>
	      </table>
</form>
</body>
</html>